<?php

	class LogView
	{			
		// Print all the errors from the log array.	
		public function ShowMessages()
		{
			// Retrieve all the messages from the logarray.
			$listOfErrors = Array();
			$listOfErrors = Log::GetErrorArray();
			$i = 0;
			$errorString = "";
			
			// Go through the list and add all the messages to the errorstring.
			foreach($listOfErrors as $message)
			{
				if ($i == count($listOfErrors) - 1)
				{
					$errorString .= $message;
				}
				else 
				{
					$errorString .= $message . "<br />";	
				}
				$i++;
			}
			return $errorString;
		}
		
		// Print all the errors from the error log.
		public function ShowErrorLog()
		{
			// Retrieve all the errors from the logfile.
			$listOfErrors = Array();
			$listOfErrors = Log::GetErrorsFromFile();
			$i = 0;
			$errorString = "<br /><b>ErrorLog</b><br />";
			
			// Go through the list and add all the errors to the errorstring.
			foreach($listOfErrors as $error)
			{
				if ($i == count($listOfErrors) - 1)
				{
					$errorString .= $error;
				}
				else 
				{
					$errorString .= "*" . $error . "<br />";
				}
				$i++;
			}
			return $errorString;
		}			
	}		